
		$(".edit_address_header p:nth-child(3)").bind("click", function() {
			var name=$(".name").val();
			var telphone=document.getElementById("telphone").value;
			var country=$(".county").val();
			var detail=$(".detail").val();
			var street = $(".street").val();
			var zip_code = $(".zip_code").val();
			var state;
			
			if($(".check").get(0).checked){
				state = 1;
			}else{
				state = 2;
			}

			//判断输入框的内容是否为空
			var myreg = /^1[3|4|5|7|8][0-9]\d{4,8}$/;
			if(name == "") {
				console.log("姓名不能为空!");
			} else if(telphone == '') {
				console.log("电话不能为空!");
			} else if(telphone.length != 11) {
				console.log("请输入有效的手机号");
			} else if(!myreg.test(telphone)) {
				console.log("请输入有效的手机号!");
			}   else if(country == "") {
				console.log("请输入地区名称");
			} else if(street == "") {
				console.log("请输入街道名称");
			}else if(zip_code == "") {
				console.log("请输入邮编");
			}
			else if(detail == "") {
				console.log("请输入详细地址");
			} else {
				$.ajax({
					type: "post",
					url: "http://a.91jfk.com/Product/Address/add_address",
					async: true,
					data: {
						name:name,
						tel:telphone,
						area:country,
						address:detail,
						state:state,
						street:street,
						zip_code:zip_code
					},
					dataType: 'json',
					success: function(res) {
						console.log(res);
						if(res.code == '1') {
							console.log("添加成功");
								location.href='guanlidizhi_mall.html';
							
						} else {
						}
					},
					error: function(err) {}
				});
			}
		});
		